<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Init</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Init</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">This class is reponsible for initializing the runtime process.</p>
<p class="description"><p>It is responsible for loading certain required files,  initializing sessions, flow, etc.... and processing the  correct files based on request and finally outputting the data.</p><p>The default output functionality, Init::display(), can be overriden  with a custom function as defined by Init::registerOutputHandler. This function  will then call the output command Init::run() itself and perform any desired  pre-display processing such as cache the output, etc...</p><p>See example site for an example registerOutputHandler.</p></p>
		<p class="notes">
			Located in <a class="field" href="_kernel---init.php.html">/kernel/init.php</a> (line <span class="field">45</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																								<div class="var-title">
					<span class="var-type">boolean</span>
					<a href="#$timer" title="details" class="var-name">$timer</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																				<div class="method-definition">
					static 						<span class="method-result">void</span>
										<a href="#registerOutputHandler" title="details" class="method-name">registerOutputHandler</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$handler</span>)
									</div>
																								<div class="method-definition">
					static 						<span class="method-result">object class</span>
										<a href="#singleton" title="details" class="method-name">singleton</a>
										()
									</div>
																								
												<div class="method-definition">
											<span class="method-result">Init</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#display" title="details" class="method-name">display</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#getInfo" title="details" class="method-name">getInfo</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#initSession" title="details" class="method-name">initSession</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#loadConfig" title="details" class="method-name">loadConfig</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#loadPrepend" title="details" class="method-name">loadPrepend</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$prepend</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#process" title="details" class="method-name">process</a>
										()
									</div>
																								<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#run" title="details" class="method-name">run</a>
										()
									</div>
																								<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#start" title="details" class="method-name">start</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#stop" title="details" class="method-name">stop</a>
										()
									</div>
								</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$timer" id="$timer"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$timer</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">82</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Execution timer flag</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodregisterOutputHandler" id="registerOutputHandler"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method registerOutputHandler</span> (line <span class="line-number">420</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Registers a function to be called on output</p>
<p class="description"><p>This function can be used to manipulate the final output before it is  displayed. It can be used to create a caching system, compress output etc...</p><p>The handler should be a callable function or array of object/method as  defined in is_callable php function.  It should accept 1 arguments: <ol><li>The reference to the init class instance</li></ol>  Note that the Init::$info property contains the current cache value  from the sitemap if set.</p><p>This function should call:       $output = Init::run();  to get the final output. The function is responsible for displaying it.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">void</span>
		<span class="method-name">
			registerOutputHandler
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$handler</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$handler</span><span class="var-description">: a function or an array of class=&gt;method</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsingleton" id="singleton"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method singleton</span> (line <span class="line-number">436</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns a class singleton.</p>
	<ul class="tags">
				<li><span class="field">return:</span> singleton instance</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">object class</span>
		<span class="method-name">
			singleton
		</span>
				()
			</div>
	
		
			
	</div>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">99</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor - inits config</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Init</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methoddisplay" id="display"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">display</span> (line <span class="line-number">348</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Displays final output</p>
<p class="description"><p>This method is called from the loader file and is  responsible for activating the run process and displaying  the output.  In the event that caching or an other pre-display processing  is needed, this method can be overriden using a callback function  registered with Init::registerOutputHandler();  This function needs to be a valid php callback (see call_user_func())  It needs to accept one argument, the reference to the Init object.  It also needs to call the static Init::run() method and capture/display  the returned string.</p><p>Here is an example</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			display
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetInfo" id="getInfo"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getInfo</span> (line <span class="line-number">372</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the gate info in an array consisting only of the params  that are specified by the sitemap. Possible items include:  uri (always present), cache, and role.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getInfo
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$data</span>			</li>
				</ul>
		
			
	</div>
<a name="methodinitSession" id="initSession"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">initSession</span> (line <span class="line-number">194</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Init sessions</p>
<p class="description"><p>This method starts up a session  and globalizes it.</p></p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			initSession
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodloadConfig" id="loadConfig"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">loadConfig</span> (line <span class="line-number">129</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Loads site configuration info</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			loadConfig
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodloadPrepend" id="loadPrepend"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">loadPrepend</span> (line <span class="line-number">148</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Loads prepend file</p>
<p class="description"><p>The prepend file is an optional file as defined in config.  While it can be used to hold any php code that the user may wish to  have processed everytime but is specifically designed to run code  before any output. Examples are headers and sessions.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			loadPrepend
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$prepend</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$prepend</span><span class="var-description">: valid php callback</span>			</li>
				</ul>
		
			
	</div>
<a name="methodprocess" id="process"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">process</span> (line <span class="line-number">237</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reads sitemap for current gate data</p>
<p class="description"><p>This function retrieves the correct gate based on request.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			process
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodrun" id="run"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">run</span> (line <span class="line-number">305</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Pocesses final output</p>
<p class="description"><p>This function processes the correct  gate based  on request. In the event of not finding the  correct gate, it will attempt to load the gate defined  under build/missing in config. Failure to do so  will result in a 404 redirect to be handled by the web server.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			run
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodstart" id="start"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">start</span> (line <span class="line-number">116</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Startup functions, init...</p>
<p class="description"><p>This method is responsible for calling all  startup functions such as timers, flow init, etc..</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			start
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodstop" id="stop"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">stop</span> (line <span class="line-number">163</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Shutdown and cleanup</p>
<p class="description"><p>This method is responsible for shutting down the  current request. It will clean up variables,  send ob to ouput, etc..</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			stop
		</span>
				()
			</div>
	
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Thu, 02 Aug 2007 17:35:19 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
	</p>
	</div></body>
</html>